#ifndef NVS_DRIVER_H
#define NVS_DRIVER_H

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "Product_Config.h"

#include "esp_system.h"
#include "nvs_flash.h"
#include "../LOG.h"

#define CUSTOM_NVS_PART_LABEL "custom_nvs"
#define CUSTOM_NVS_PART_NAMESPACE   "storage"
#define WIFI_SSID "wifi_ssid" //wifi名称
#define WIFI_PSWD "wifi_pswd" //wifi密码
#define APP_STATUS "app_status" //逻辑状态
#define BRIGH_LEVEL "brigh_level" //灯光亮度信息
#define UVBRIGH_LEVEL "uv_brigh_level" //灯光亮度信息
#define UVSWITCH "uvswitch" //灯光亮度信息
#define LIGHT_LEN "light_len" //灯带长度信息
#define MICROSENST "micro_senst" //麦克风灵敏度
#define AUDIOSOURE "audio_soure" //音频源
#define AUDIODATA "audio_data" //音频数据
#define SPECTRALMODE "spectral_mode" //音频模式
#define MODESCENE "scene_mode" //场景模式
#define CUSTOMSSP "custom_ssp" //自定义工作模式

u8 driver_nvs_init();
esp_err_t driver_nvs_part_init();
esp_err_t driver_nvs_part_write_str(const char *str_key,const char *str_val);
esp_err_t driver_nvs_part_read_str(const char *str_key,char *str_get_val,size_t *str_val_len);
esp_err_t driver_nvs_part_write_u8(const char *str_key,u8 *u8_val);
esp_err_t driver_nvs_part_read_u8(const char *str_key,u8 *u8_val);
#endif 